/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package reamodel.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

import reamodel.DecrementEconomicEventType;
import reamodel.IncrementCommitment;
import reamodel.IncrementEconomicEvent;
import reamodel.IncrementEconomicEventType;
import reamodel.InflowType;
import reamodel.ReamodelPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Increment Economic Event Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link reamodel.impl.IncrementEconomicEventTypeImpl#getSpecify <em>Specify</em>}</li>
 *   <li>{@link reamodel.impl.IncrementEconomicEventTypeImpl#getTypify <em>Typify</em>}</li>
 *   <li>{@link reamodel.impl.IncrementEconomicEventTypeImpl#getInflowType <em>Inflow Type</em>}</li>
 *   <li>{@link reamodel.impl.IncrementEconomicEventTypeImpl#getDualityType <em>Duality Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class IncrementEconomicEventTypeImpl extends EconomicEventTypeImpl implements IncrementEconomicEventType {
	/**
	 * The cached value of the '{@link #getSpecify() <em>Specify</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSpecify()
	 * @generated
	 * @ordered
	 */
	protected EList<IncrementCommitment> specify;

	/**
	 * The cached value of the '{@link #getTypify() <em>Typify</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTypify()
	 * @generated
	 * @ordered
	 */
	protected EList<IncrementEconomicEvent> typify;

	/**
	 * The cached value of the '{@link #getInflowType() <em>Inflow Type</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInflowType()
	 * @generated
	 * @ordered
	 */
	protected EList<InflowType> inflowType;

	/**
	 * The cached value of the '{@link #getDualityType() <em>Duality Type</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDualityType()
	 * @generated
	 * @ordered
	 */
	protected EList<DecrementEconomicEventType> dualityType;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected IncrementEconomicEventTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ReamodelPackage.Literals.INCREMENT_ECONOMIC_EVENT_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<IncrementCommitment> getSpecify() {
		if (specify == null) {
			specify = new EObjectResolvingEList<IncrementCommitment>(IncrementCommitment.class, this, ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__SPECIFY);
		}
		return specify;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<IncrementEconomicEvent> getTypify() {
		if (typify == null) {
			typify = new EObjectWithInverseResolvingEList<IncrementEconomicEvent>(IncrementEconomicEvent.class, this, ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY, ReamodelPackage.INCREMENT_ECONOMIC_EVENT__TYPIFIED_BY);
		}
		return typify;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<InflowType> getInflowType() {
		if (inflowType == null) {
			inflowType = new EObjectContainmentWithInverseEList<InflowType>(InflowType.class, this, ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE, ReamodelPackage.INFLOW_TYPE__EVENT_TYPE);
		}
		return inflowType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<DecrementEconomicEventType> getDualityType() {
		if (dualityType == null) {
			dualityType = new EObjectWithInverseResolvingEList.ManyInverse<DecrementEconomicEventType>(DecrementEconomicEventType.class, this, ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE, ReamodelPackage.DECREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE);
		}
		return dualityType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getTypify()).basicAdd(otherEnd, msgs);
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getInflowType()).basicAdd(otherEnd, msgs);
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getDualityType()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY:
				return ((InternalEList<?>)getTypify()).basicRemove(otherEnd, msgs);
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE:
				return ((InternalEList<?>)getInflowType()).basicRemove(otherEnd, msgs);
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE:
				return ((InternalEList<?>)getDualityType()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__SPECIFY:
				return getSpecify();
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY:
				return getTypify();
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE:
				return getInflowType();
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE:
				return getDualityType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__SPECIFY:
				getSpecify().clear();
				getSpecify().addAll((Collection<? extends IncrementCommitment>)newValue);
				return;
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY:
				getTypify().clear();
				getTypify().addAll((Collection<? extends IncrementEconomicEvent>)newValue);
				return;
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE:
				getInflowType().clear();
				getInflowType().addAll((Collection<? extends InflowType>)newValue);
				return;
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE:
				getDualityType().clear();
				getDualityType().addAll((Collection<? extends DecrementEconomicEventType>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__SPECIFY:
				getSpecify().clear();
				return;
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY:
				getTypify().clear();
				return;
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE:
				getInflowType().clear();
				return;
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE:
				getDualityType().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__SPECIFY:
				return specify != null && !specify.isEmpty();
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__TYPIFY:
				return typify != null && !typify.isEmpty();
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__INFLOW_TYPE:
				return inflowType != null && !inflowType.isEmpty();
			case ReamodelPackage.INCREMENT_ECONOMIC_EVENT_TYPE__DUALITY_TYPE:
				return dualityType != null && !dualityType.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //IncrementEconomicEventTypeImpl
